package com.sh.threadmethod.threadmethod;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class JoinMethod implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.println("vip线程来了");
        }
    }


    public static void main(String[] args) throws InterruptedException {
        JoinMethod join = new JoinMethod();
        Thread thread = new Thread(join);
        thread.start();
        for (int i = 0; i < 5; i++) {
            if (i==2){
                thread.join();
            }
            System.out.println("普通线程来了"+i+"次");
        }

    }
}

